//
//  MTLuckyRuleViewController.swift
//  MT
//
//  Created by ooops on 2020/1/22.
//  Copyright © 2020 张强. All rights reserved.
//

import UIKit
import MTCategory
import YPNavigationBarTransition

class MTLuckyRuleViewController: BaseViewController {

    
    private var rule: String = ""
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "抽奖规则"
        
        view.addSubview(scrollView)
        scrollView.addSubview(ruleLabel)
        
        ruleLabel.snp.makeConstraints { (make) in
            make.edges.equalTo(UIEdgeInsets(top: 20, left: 18, bottom: 20, right: 18))
        }
    }
    
    lazy var scrollView: UIScrollView = {
        let scr = UIScrollView()
        scr.frame = CGRect(x: 0, y: NavigationBarHeight + StatusBarHeight, width: ScreenWidth, height: ScreenHeight - NavigationBarHeight - StatusBarHeight)
        scr.contentSize = CGSize(width: ScreenWidth, height: ScreenHeight - NavigationBarHeight - StatusBarHeight)
        scr.backgroundColor = .white
        scr.contentInsetAdjustmentBehavior = .never
        return scr
    }()
    
    lazy var ruleLabel: YYLabel = {
        let l = YYLabel()
        l.font = PingFangSCMediumFont(14)
        l.textColor = UIColor.text.x1d1a1a
        l.textVerticalAlignment = .top
        l.preferredMaxLayoutWidth = ScreenWidth - 36
        l.numberOfLines = 0
        return l
    }()
    

    convenience init(rule: String) {
        self.init()
        
        self.rule = rule
        ruleLabel.text = rule
    }
    
    

}

extension MTLuckyRuleViewController {
    override func yp_navigtionBarConfiguration() -> YPNavigationBarConfigurations {
        return [.backgroundStyleColor, .showShadowImage, .backgroundStyleOpaque]
    }
}
